package com.hejx.security.mapper;

import com.hejx.security.pojo.Resource;
import com.hejx.security.pojo.ResourceExample;
import com.hejx.security.pojo.Role;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ResourceMapper {
    int countByExample(ResourceExample example);

    int deleteByExample(ResourceExample example);

    int deleteByPrimaryKey(Long id);

    int insert(Resource record);

    int insertSelective(Resource record);

    List<Resource> selectByExample(ResourceExample example);

    Resource selectByPrimaryKey(Long id);

    int updateByExampleSelective(@Param("record") Resource record, @Param("example") ResourceExample example);

    int updateByExample(@Param("record") Resource record, @Param("example") ResourceExample example);

    int updateByPrimaryKeySelective(Resource record);

    int updateByPrimaryKey(Resource record);

    /**
     * 根据角色查询资源权限
     * @param roles
     * @return
     */
    List<Resource> selectByRoles(List<Role> roles);

}